<template>
<div class="selector">
<div class="type-wrap logo">
  <div class="brand">品牌</div>
  <div class="value">
    <ul class="logo-list">
<!--      <li v-for="(tradeMark,index)in tradeList" :key="tradeMark.tmId">{{tradeMark.tmName}}</li>-->
      <li v-for="(tradeMark,index) in getTrademarkList" :key="tradeMark.tmId" @click="getBrand(tradeMark)">{{tradeMark.tmName}}</li>
    </ul>
  </div>
</div>
  <div class="type-wrap" v-for="(attr,index) in getAttrsList" :key="index">
    <div class="brand2">{{attr.attrName}}</div>
    <div class="value2">
      <ul class="logo-list2" v-for="(attrValue,index) in attr.attrValueList" :key="index">
        <li @click="attrInfo(attr,attrValue)"><a href="javascript:void(0)">{{attrValue}}</a></li>
      </ul>
    </div>
  </div>
</div>
</template>

<script>
import {mapGetters} from 'vuex'
export default {
  name: "SearchSelector",
  mounted() {

  },
  methods:{
    getBrand(tradeMark){
        this.$emit('trandemark',tradeMark)
    },
    attrInfo(attr,attrValue){
      this.$emit('attr',attr,attrValue)
    }
  },
  computed:{
    ...mapGetters(['getTrademarkList','getAttrsList'])
  }
}
</script>

<style scoped lang="less">
.type-wrap{
    height: 37px;
    width: 1200px;
  margin: 0 auto;
    border-top: 1px solid #ddd;
    .brand2{
      font-size: 12px;
      float: left;
      width: 125px;
      height: 36px;
      background: #f1f1f1;
      line-height: 36px;
      text-align: center;
    }
    .value2{
      width: 1000px;
      height: 27px;
      float: left;
      padding-left:15px;
      padding-top: 10px;
      li{
        float: left;
        font-weight: 700;
        font-family: "Microsoft YaHei";
        margin-right: 30px;
        a{
          font-size: 12px;
          color: #666;
          font-weight: normal;
        }
      }
    }
}
.selector{
  margin-bottom: 5px;
  width: 100%;
  height: auto;
  border: 1px solid #ddd;
  .logo {
    height: 124px;
    width: 100%;
    margin: 0 auto;
    border-top: 1px solid #ddd;
    .brand {
      font-size: 12px;
      float: left;
      width: 125px;
      height: 123px;
      background: #f1f1f1;
      line-height: 123px;
      text-align: center;
    }

    .value {
      width: 1000px;
      float: left;
      padding-left: 15px;
      padding-top: 10px;
        li {
          float: left;
          font-size: 14px;
          color: rgb(225, 37, 27);
          font-weight: 700;
          font-family: "Microsoft YaHei";
          width: 107px;
          text-overflow: ellipsis;//防止文本溢出,多出来的加...
          white-space: nowrap;//让文本不换行
          overflow: hidden;//将多出来的字隐藏
          height: 54px;
          border: 1px solid #e4e4e4;
          text-align: center;
          line-height: 54px;
        }
      }
    }
}
</style>
